package com.ftg.learn.datahandle.controller;

import com.ftg.learn.datahandle.service.SubjectScoreService;
import com.ftg.learn.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * 数据处理总类
 *
 * @author 布衣
 */
@RestController
@RequestMapping("/dataHandle")
@Tag(name = "数据处理总类")
public class DataHandleController {

    @Resource
    SubjectScoreService subjectScoreService;

    @Operation(summary = "读取excel")
    @PostMapping("/readExcel")
    public R<String> readExcel(@RequestPart("file") MultipartFile file) {
        return subjectScoreService.readExcelWithSubjectScore(file);
    }

    @Operation(summary = "下载excel模板")
    @PostMapping("/downExcelTemplate")
    public R<String> downExcelTemplate() {
        return R.success("success");
    }


    @Operation(summary = "批量读取excel")
    @PostMapping("/readExcels")
    public R<String> readExcels() {
        return R.success("success");
    }

}
